import Router from 'vue-router'
import Vue from 'vue'
import Login from "../views/Login.vue";
import Main from "../views/Main.vue";
import Profile from "../views/user/Profile.vue";
import List from "../views/user/List.vue";
import NotFound from "../views/NotFound.vue";

Vue.use(Router);

export default new Router({
    mode: 'history',
    routes: [
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/main/:name',
            name: 'main',
            props: true,
            component: Main,
            children: [
                {path: '/user/profile/:id',name:'profile', component:Profile, props:true },
                {path: '/user/list',name:'list', component:List },
            ]
        },
        {
            path:'goHome',
            redirect:'/main'
        },{
            path: '*',
            component: NotFound
        }
    ]
});